package com.nbcio.pm.mapper;

import com.nbcio.common.mybatis.core.mapper.BaseMapperPlus;
import com.nbcio.pm.domain.PmTaskDependency;
import com.nbcio.pm.domain.vo.PmTaskDependencyVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 任务依赖Mapper接口
 *
 * @author nbacheng
 */
public interface PmTaskDependencyMapper extends BaseMapperPlus<PmTaskDependency, PmTaskDependencyVo> {

    /**
     * 查询任务依赖关系
     *
     * @param taskId 任务ID
     * @return 依赖关系列表
     */
    List<PmTaskDependencyVo> selectTaskDependencies(@Param("taskId") Long taskId);

    /**
     * 检查依赖关系是否存在
     *
     * @param predecessorId 前置任务ID
     * @param successorId 后续任务ID
     * @return 是否存在
     */
    Boolean checkDependencyExists(@Param("predecessorId") Long predecessorId, @Param("successorId") Long successorId);
}
